# Contributor: shrizza <shrizza@gmail.com>
# Maintainer: shrizza <shrizza@gmail.com>
pkgname="avara"
_sha="b8700db3c696b9813b511b06a92c9faab55b282a"
pkgver="0_git20191006"
pkgrel=1
pkgdesc="Port of the original 1996 Mac OS game from Ambrosia Software"
url="https://github.com/avaraline/Avara"
arch="all"
license="MIT"
makedepends="clang clang-dev directfb-dev glu-dev sdl2_net-dev sdl2_mixer-dev sdl2"
options="!check"
subpackages="$pkgname-doc"
source="avara
	$pkgname-$pkgver.zip::https://github.com/avaraline/Avara/archive/$_sha.zip
	fix-includes.patch"
builddir="$srcdir/Avara-$_sha"

build() {
	make
}

package() {
	mkdir -p "$pkgdir/usr/bin/"
	install -Dm755 ../avara "$pkgdir/usr/bin/"
	mkdir -p "$pkgdir/var/games/$pkgname/"
	cp -r build/Avara "$pkgdir/var/games/$pkgname/"
	cp -r build/bsps "$pkgdir/var/games/$pkgname/"
	cp -r build/levels "$pkgdir/var/games/$pkgname/"
	cp -r build/rsrc "$pkgdir/var/games/$pkgname/"
	cp -r build/shaders "$pkgdir/var/games/$pkgname/"
	mkdir -p "$pkgdir/usr/share/doc/$pkgname/"
	install -Dm644 CONTRIBUTORS.md "$pkgdir/usr/share/doc/$pkgname/"
	install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/"
}

sha512sums="
928326dad78b077fe82f13f9c56a00996ef8555108e0964a72e73c84fb073a2d6a9e7a545d129f90386f5f30cf7976abc29a38ff71f7c6e114521f6c0dcd36bf  avara
03dfb9b173749fac97591053cd7d55976617eb4fb64bcb4286a1b511d18dcb557dcbb408bf4c4e5d5bf7c47f41b2134808613938a9535c51d5e486e123a9271c  avara-0_git20191006.zip
0e7e3522c0d2b2ac202951aecaafc5a7ce98f1a08f0f5876c97550457ae432662c569bfd6fe90cff2fee19e0ed4bd19c28b4b1a5aefab94813c2fc68275475df  fix-includes.patch
"
